<div class="fm-content">
    <!-- 最上面标题栏 -->
    <div class="title">
        <i nz-icon [type]="'desktop'"></i>
        &nbsp;&nbsp;公安工作数据
    </div>
    <!-- 内容 -->
    <div class="work">

        <!-- 查询框 -->
        <div class="top">
            <!-- first-input -->
            <nz-select class="fm-input first-input" (nzOpenChange)="airportDic.load('0')"
                [(ngModel)]="fs.queryObject['airport:=']" [nzPlaceHolder]="'所属机场'">
                <nz-option *ngFor="let option of airportDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
                </nz-option>
                <nz-option *ngIf="airportDic.isLoading" nzDisabled nzCustomContent>
                    <i nz-icon type="loading" class="loading-icon"></i>加载中...
                </nz-option>
            </nz-select>
            <nz-button-group>
                <button nz-button nzType="primary" (click)="fs.loadData(true)">查询</button>
                <button nz-button (click)="fs.resetQueryObject() && fs.loadData(true)">重置</button>
            </nz-button-group>
            <div class="tool-right">
                <nz-button-group>
                    <button *ngIf="ss.mi.sa || ss.mi.gagzxz" nz-button [nzType]="'primary'" (click)="addRow()">新增</button>
                    <!-- <button nz-button (click)="fs.editRow()">编辑</button> -->
                    <button *ngIf="ss.mi.sa || ss.mi.gagzsc" nz-popconfirm nzTitle="确认删除选择项?" (nzOnConfirm)="fs.delEntitys()" nzPlacement="bottomRight"
                        nz-button>删除</button>
                  <a nz-button href="assets/images/公安工作.xls" download="公安工作.xls">模板下载</a>
                  <button nz-button (click)="fs.export('xjmh_gagz.html', '公安工作.xls')">导出</button>
                  <nz-upload nzAction="{{ fs.getExcelUploadUrl() }}" [nzLimit]="1" [nzHeaders]="ffs.fileHeaders"
                             [nzFilter]="fs.excelFilters" [nzAccept]="'.xls,.xlsx'" (nzChange)="excelHandleChange($event)">
                    <button *ngIf="ss.mi.sa || ss.mi.gagzxz" nz-button>导入</button>
                  </nz-upload>
                </nz-button-group>
            </div>
        </div>

        <!-- 右则样表单主体 -->
        <div class="work-content">
            <div class="table">
                <nz-table nzSize="middle" nzShowSizeChanger [nzPageSizeOptions]='[ 10, 15, 20, 30, 40, 50 ]'
                    [nzFrontPagination]="false" [nzData]="fs.datas" [nzLoading]="fs.isLoading || fs.isDeleing"
                    [nzTotal]="fs.rowsCount" [(nzPageIndex)]="fs.pageIndex" [(nzPageSize)]="fs.pageSize"
                    (nzPageIndexChange)="fs.loadData()" (nzPageSizeChange)="fs.loadData(true)"
                    [nzScroll]="{ x: '2300px' }">
                    <thead>
                        <tr>
                            <th nzWidth="50px" nzShowCheckbox [(nzChecked)]="fs.allChecked"
                                [nzIndeterminate]="fs.indeterminate" (nzCheckedChange)="fs.checkAll($event)"></th>
                            <th nzWidth="100px">所属机场</th>
                            <th nzWidth="150px">出动公安警力(人次)</th>
                            <th nzWidth="150px">巡逻盘查人员(人次)</th>
                            <th nzWidth="150px">检查车辆(辆)</th>
                            <th nzWidth="150px">查获违禁物品(件)</th>
                            <th nzWidth="150px">查获各类治安案件(件)</th>
                            <th nzWidth="150px">查获各类刑事案件(件)</th>
                            <th nzWidth="150px">抓获违法犯罪人员(人)</th>
                            <th nzWidth="150px">查获涉恐人员(人)</th>
                            <th nzWidth="150px">查获涉XX上访人员(人)</th>
                            <th nzWidth="150px">查获网上在逃人员(人)</th>
                            <th nzWidth="150px">查获邪教人员(人)</th>
                            <th nzWidth="150px">检查各类安全隐患(起)</th>
                            <th nzWidth="100px">工作时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let data of fs.datas">
                            <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="fs.refreshCheckStatus()">
                            </td>
                            <!-- <td><span (click)="fs.editRow(data)" class="form-edit"></span></td> -->
                            <td><span (click)="fs.editRow(data)" class="form-edit">{{data.airportName}}</span></td>
                            <td>{{data.sendpolice === null ? 0 : data.sendpolice}}</td>
                            <td>{{data.patrolperson === null ? 0 : data.patrolperson}}</td>
                            <td>{{data.checkcar === null ? 0 : data.checkcar}}</td>
                            <td>{{data.bangoods === null ? 0 : data.bangoods}}</td>
                            <td>{{data.securitycase === null ? 0 : data.securitycase}}</td>
                            <td>{{data.criminalcase === null ? 0 : data.criminalcase}}</td>
                            <td>{{data.criminalperson === null ? 0 : data.criminalperson}}</td>
                            <td>{{data.terroristperson === null ? 0 : data.terroristperson}}</td>
                            <td>{{data.upperson === null ? 0 : data.upperson}}</td>
                            <td>{{data.escapeperson === null ? 0 : data.escapeperson}}</td>
                            <td>{{data.cultperson === null ? 0 : data.cultperson}}</td>
                            <td>{{data.hidedanger === null ? 0 : data.hidedanger}}</td>
                            <td>{{data.temporaryTime | date:'yyyy-MM-dd'}}</td>
                        </tr>
                    </tbody>
                </nz-table>
            </div>
        </div>

        <nz-modal nzWidth='830' nzTitle="编辑" [nzMaskClosable]='false' [nzFooter]="null" [(nzVisible)]="fs.isEditVisible"
            (nzOnCancel)="fs.closeEdit()">
            <form nz-form [nzLayout]="'inline'">
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">所属机场</nz-form-label>
                            <nz-form-control class="form-control" [nzValidateStatus]="!fs.er.airport?'error':'success'"
                                nzHasFeedback>
                                <nz-select class="fm-input" [(ngModel)]="fs.er.airport" name="airport" [disabled]="fs.er.airport">
                                    <nz-option *ngFor="let option of airportDic.datas" [nzLabel]="option.display"
                                        [nzValue]="option.id">
                                    </nz-option>
                                    <nz-option *ngIf="airportDic.isLoading" nzDisabled nzCustomContent>
                                        <i nz-icon type="loading" class="loading-icon"></i>加载中...
                                    </nz-option>
                                </nz-select>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">出动公安警力</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="sendpolice.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.sendpolice" name="sendpolice" required
                                    #sendpolice="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                </div>
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">巡逻盘查人员</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="patrolperson.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.patrolperson" name="patrolperson" required
                                    #patrolperson="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">检查车辆</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="checkcar.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.checkcar" name="checkcar" required
                                    #checkcar="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                </div>
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">查获违禁物品</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="bangoods.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.bangoods" name="bangoods" required
                                    #bangoods="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">查获各类治安案件</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="securitycase.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.securitycase" name="securitycase" required
                                    #securitycase="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                </div>
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">查获各类刑事案件</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="criminalcase.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.criminalcase" name="criminalcase" required
                                    #criminalcase="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">抓获违法犯罪人员</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="criminalperson.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.criminalperson" name="criminalperson" required
                                    #criminalperson="ngModel" [nzMin]="0"  [nzStep]="1"
                                    class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                </div>
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">查获涉恐人员</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="terroristperson.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.terroristperson" name="terroristperson" required
                                    #terroristperson="ngModel" [nzMin]="0"  [nzStep]="1"
                                    class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">查获涉XX上访人员</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="upperson.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.upperson" name="upperson" required
                                    #upperson="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                </div>
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">查获网上在逃人员</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="escapeperson.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.escapeperson" name="escapeperson" required
                                    #escapeperson="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">查获邪教人员</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="cultperson.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.cultperson" name="cultperson" required
                                    #cultperson="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                </div>
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="12">
                        <nz-form-item>
                            <nz-form-label nzRequired class="form-label">检查各类安全隐患</nz-form-label>
                            <nz-form-control class="form-control"
                                [nzValidateStatus]="hidedanger.invalid?'error':'success'" nzHasFeedback>
                                <nz-input-number [(ngModel)]="fs.er.hidedanger" name="hidedanger" required
                                    #hidedanger="ngModel" [nzMin]="0"  [nzStep]="1" class="form-control">
                                </nz-input-number>
                            </nz-form-control>
                        </nz-form-item>
                    </div>
                  <div nz-col [nzSpan]="12">
                    <nz-form-item>
                      <nz-form-label nzRequired class="form-label">工作日期</nz-form-label>
                      <nz-form-control class="form-control" [nzValidateStatus]="temporaryTime.invalid?'error':'success'"
                                       nzHasFeedback>
                        <nz-date-picker class="fm-input first-input" name="temporaryTime" required
                                        [(ngModel)]="fs.er.temporaryTime" #temporaryTime="ngModel"
                                        name="selectDate"></nz-date-picker>
                      </nz-form-control>
                    </nz-form-item>
                  </div>
                </div>
                <div nz-row [nzGutter]="24">
                    <div nz-col [nzSpan]="24" class="form-button-align">
                        <button nz-button nzType="default" (click)="fs.closeEdit()" class="form-button">取消</button>
                        <button *ngIf="ss.mi.sa || ss.mi.gagzxg" nz-button nzType="primary" [disabled]='!fs.er.airport' (click)="fs.save()"
                            [nzLoading]="fs.isSaveing">保存</button>
                    </div>
                </div>
            </form>
        </nz-modal>
    </div>
</div>
